package com.cm.study.other.design.patterns.proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class IServiceProxy implements InvocationHandler {

    private IService iService;

    public IServiceProxy(IService iService) {
        this.iService = iService;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("代理执行前");
        method.invoke(iService,args);
        System.out.println("代理执行后");
        return null;
    }
}
